import React,{ Component , Fragment} from 'react';
import cities from '../../assets/cities/cities';
import CitiesItem from './CitiesItem'
import './cities.css'
export default class Cities extends Component{
    constructor(props){
        super(props);
        this.state={
            cities:cities
        }
    }

    showCitiesLists=()=>{
        let citiesArray = Object.entries(this.state.cities);
        return citiesArray.map((item,index)=>{
            return (
                <CitiesItem config={item} key={index}/>
            )
        })
    }

    render(){
        
        return(
            <Fragment>
                {this.showCitiesLists()}
            </Fragment>
        )
    }
}